/**
 * @type {UUID}
 * @properties={typeid:35,uuid:"B6D32AC1-1095-4906-81ED-2137888882FB",variableType:-4}
 */
var $adm_t900_aplicaciones_id = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5B74EFE1-7C00-4C65-BE5D-56EC056E5D9E"}
 */
function _borrar(event) {

	foundset.deleteRecord(foundset.getSelectedRecord());
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"2EA4A608-2D71-4B05-B66B-16D2DE4C3CEF"}
 */
function onRender(event) {
	
	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = event.getRecord();
	
	if (record && record.adm_t900_menus_padre_id == null) {
		event.getRenderable().fgcolor = 'red';
	} else{
		event.getRenderable().fgcolor = "#808080";
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"9695363C-205F-499D-85BF-33B5974E461B"}
 */
function cambiar_es_super_adm(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = foundset.getSelectedRecord();
	record.b_es_super_adm = (record.b_es_super_adm == 1 ? 0 : 1);
	databaseManager.saveData(record);
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"4861558C-5636-4A94-A199-00120B5049C8"}
 */
function onShow(firstShow, event) {
	
	$adm_t900_aplicaciones_id = null;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"1EAE7022-2525-402B-B1E2-944133E3BE54"}
 * @AllowToRunInFind
 */
function filtrar_por_aplicaciones(event) {

	if (foundset.find()){
		foundset.adm_t900_aplicaciones_id = $adm_t900_aplicaciones_id;
		foundset.search();
	}
}
